function GetNumberOfK(data, k)
{
    // write code here
    // 二分查找法 查找这个数字的插入位置
    function findRightPos(x){
      var left = 0
      var right = data.length -1
      while(left <= right){
        var mid = left + Math.floor((right - left)/2)
        if(data[mid] <= x){
          left = mid+1
        }else{
          right = mid - 1
        }
      }
      return left
    }
    return findRightPos(k) - findRightPos(k-1)
}
module.exports = {
    GetNumberOfK : GetNumberOfK
};